﻿<%@ Page Language="C#" MasterPageFile="~/MasterAdmin.Master" AutoEventWireup="true" CodeBehind="QuanLyCongTyVanChuyen.aspx.cs" Inherits="EC21_EDiamond.Admin.QuanLyCongTyVanChuyen" %>


<asp:Content ID="Content1" runat="server" contentplaceholderid="HeadContent">
     <table style="width: 100%;">
        <tr>
            <td colspan="2" class="text-center" style="font-size: xx-large; color: #0000FF"><strong>QUẢN LÝ CÔNG TY VẬN CHUYỂN</strong></td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Tên CTVC:</td>
            <td class="text-left">
                 <asp:TextBox ID="txtTenCTVC" runat="server" Width="170px" placeholder="Tên CTVC"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtTenCTVC" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
         <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Địa chỉ:</td>
            <td class="text-left">
                 <asp:TextBox ID="txtDiaChi" runat="server" Width="170px" placeholder="Địa chỉ"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDiaChi" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
         <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Điện thoại:</td>
            <td class="text-left">
                 <asp:TextBox ID="txtDienThoai" runat="server" Width="170px" placeholder="Điện thoại"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDienThoai" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
         <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Email:</td>
            <td class="text-left">
                 <asp:TextBox ID="txtEmail" runat="server" Width="170px" placeholder="Email"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtEmail" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail" ErrorMessage="Địa Chỉ Email không hợp lệ!" style="color: #FF0000" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
        </tr>
         <tr>
             <td></td>
             <td class="text-left">
                 <asp:Button ID="btnThemCTVC" runat="server" Text="Thêm" Width="93px" OnClick="btnThemCTVC_Click" /></td>
         </tr>
    </table>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaCTVC" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Horizontal" Width="100%">
        <Columns>
            <asp:BoundField DataField="MaCTVC" HeaderText="Mã CTVC" InsertVisible="False" ReadOnly="True" SortExpression="MaCTVC" />
            <asp:BoundField DataField="TenCTVC" HeaderText="Tên CTVC" SortExpression="TenCTVC" />
            <asp:BoundField DataField="DiaChi" HeaderText="Địa chỉ" SortExpression="DiaChi" />
            <asp:BoundField DataField="DienThoai" HeaderText="Điện thoại" SortExpression="DienThoai" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:CommandField ShowEditButton="True" ShowDeleteButton="True" />
        </Columns>
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#242121" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>" DeleteCommand="DELETE FROM [CongTyVanChuyen] WHERE [MaCTVC] = @original_MaCTVC AND (([TenCTVC] = @original_TenCTVC) OR ([TenCTVC] IS NULL AND @original_TenCTVC IS NULL)) AND (([DiaChi] = @original_DiaChi) OR ([DiaChi] IS NULL AND @original_DiaChi IS NULL)) AND (([DienThoai] = @original_DienThoai) OR ([DienThoai] IS NULL AND @original_DienThoai IS NULL)) AND (([Email] = @original_Email) OR ([Email] IS NULL AND @original_Email IS NULL))" InsertCommand="INSERT INTO [CongTyVanChuyen] ([TenCTVC], [DiaChi], [DienThoai], [Email]) VALUES (@TenCTVC, @DiaChi, @DienThoai, @Email)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [CongTyVanChuyen]" UpdateCommand="UPDATE [CongTyVanChuyen] SET [TenCTVC] = @TenCTVC, [DiaChi] = @DiaChi, [DienThoai] = @DienThoai, [Email] = @Email WHERE [MaCTVC] = @original_MaCTVC AND (([TenCTVC] = @original_TenCTVC) OR ([TenCTVC] IS NULL AND @original_TenCTVC IS NULL)) AND (([DiaChi] = @original_DiaChi) OR ([DiaChi] IS NULL AND @original_DiaChi IS NULL)) AND (([DienThoai] = @original_DienThoai) OR ([DienThoai] IS NULL AND @original_DienThoai IS NULL)) AND (([Email] = @original_Email) OR ([Email] IS NULL AND @original_Email IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_MaCTVC" Type="Int32" />
            <asp:Parameter Name="original_TenCTVC" Type="String" />
            <asp:Parameter Name="original_DiaChi" Type="String" />
            <asp:Parameter Name="original_DienThoai" Type="String" />
            <asp:Parameter Name="original_Email" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="TenCTVC" Type="String" />
            <asp:Parameter Name="DiaChi" Type="String" />
            <asp:Parameter Name="DienThoai" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="TenCTVC" Type="String" />
            <asp:Parameter Name="DiaChi" Type="String" />
            <asp:Parameter Name="DienThoai" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="original_MaCTVC" Type="Int32" />
            <asp:Parameter Name="original_TenCTVC" Type="String" />
            <asp:Parameter Name="original_DiaChi" Type="String" />
            <asp:Parameter Name="original_DienThoai" Type="String" />
            <asp:Parameter Name="original_Email" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>



